package study.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import study.dao.entity.MovieUser;

/*
	fallbackFactory: 可以获取触发fallback的原因
 */
@FeignClient(name = "sunxj-microservice-provider-user", /*fallback = UserFeignClientFallback.class,*/
             fallbackFactory = UserFeignClientFallbackFactory.class)
public interface UserFeignClient {
	
	/**
	 * 两个坑：
	 * 1、不支持GetMapping
	 * 2、@PathVariable()的value得有值
	 * 
	 * 
	 * 注：@RequestMapping(value="/simple/{id}", method = RequestMethod.GET)
	 *    该注解要与被调用方法的注解一样
	 */
	@RequestMapping(value="/simple/{id}", method = RequestMethod.GET)
	public MovieUser selectById(@PathVariable("id") int id);
	
}
